<template>
	<view class="container">
		<image style="display: block;width: 100%;" mode='widthFix' :src="staticURL+'/static/operation/yqjl-icon.png'">
		</image>
		<div class="list-box">
			<div style="display: flex;justify-content:space-evenly">
				<!-- <u-tabs :list="list" @click="tabsClick"></u-tabs> -->
				<div @click="tabsClick(index)" :key='index' :class="['tab-box',tabid == index?'active':'']"
					v-for='(item,index) in list'>
					{{ item.name }}
				</div>
			</div>
			<view class="yq-arr-list">
				<view class="yq-arr-item" v-for="(item,index) in yqArr" :key='index'>
					<view class="yq-left">
						<!-- <view class="head-img">
							<img :src="item.img" alt="">
						</view> -->
						<view>
							<view style="font-size: 32rpx;">{{item.customerName}}</view>
							<view style="font-size: 28rpx;">{{item.inviteTime}}</view>
						</view>
					</view>
					<view class="yq-right">{{item.customerPhone}}</view>
				</view>
			</view>
		</div>
	</view>
</template>
<script>
	import {
		inviteRecordList
	} from '@/api/axios/operation.js'
	export default {
		data() {
			return {
				staticURL: this.staticURL,
				list: [{
					name: '已邀请',
				}, {
					name: '已到院',
				}],
				yqArr: [

					// {
					// 	inviteTime: '12月12日 18:10',
					// 	customerName: '大鱼海棠',
					// 	customerPhone: '123123123c'
					// }
				],
				tabid: 0
			}
		},
		methods: {
			tabsClick(index) {
				this.tabid = index
				let customerId = uni.getStorageSync('customerId')
				if (index == 0) {
					inviteRecordList({
						params: {
							customerId: customerId,
							type: '1'
						}
					}).then(res => {
						this.yqArr = res
					})
				} else {

					inviteRecordList({
						params: {
							customerId: customerId,
							type: '2'
						}
					}).then(res => {
						this.yqArr = res
					})
				}
			}
		},
		onLoad() {
			let customerId = uni.getStorageSync('customerId')

			inviteRecordList({
				params: {
					customerId: customerId,
					type: '1'
				}
			}).then(res => {
				this.yqArr = res
			})

		}
	}
</script>
<style scoped lang="scss">
	@import './index.scss'
</style>